package com.telnetnz.ticketdesk.dao.wrapper;

import java.util.List;

import net.sf.ehcache.Cache;

import com.rockbb.common.dao.CacheManagerBean;
import com.telnetnz.ticketdesk.dao.entity.ConfigEntity;
import com.telnetnz.ticketdesk.dao.mapper.ConfigMapper;

public class ConfigWrap 
{
	private ConfigMapper mapper;
	private Cache cache;

	public ConfigWrap() {}

	public ConfigWrap(
			ConfigMapper mapper, 
			CacheManagerBean cacheManagerBean) 
	{
		this.mapper = mapper;
		this.cache = cacheManagerBean.get(mapper.getClass().getName());
	}

	public ConfigEntity select(String name)
	{
		return mapper.select(name);
	}

	public List<ConfigEntity> selectAll()
	{
		return mapper.selectAll();
	}

	public void update(ConfigEntity entity) 
	{
		mapper.update(entity);
	}

	public Cache getCache() 
	{
		return cache;
	}
}

